package shiro.com.controller.file;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import shiro.com.basie.controller.BaseController;
import shiro.com.basie.domain.AjaxResult;
import shiro.com.domain.TableDataInfo;
import shiro.com.domain.file.UserFileUp;
import shiro.com.service.file.IUserFileUpService;

/**
 * 【请填写功能名称】Controller
 *
 * @author ruoyi
 * @date 2022-12-14
 */
@RestController
@RequestMapping("/ufu/up")
public class UserFileUpController extends BaseController
{
    @Autowired
    private IUserFileUpService userFileUpService;

    /**
     * 查询【请填写功能名称】列表
     */
    @GetMapping("/list")
    public TableDataInfo list(UserFileUp userFileUp)
    {

        List<UserFileUp> list = userFileUpService.selectUserFileUpList(userFileUp);
        return getDataTable(list);
    }

//    /**
//     * 导出【请填写功能名称】列表
//     */
//    @PreAuthorize("@ss.hasPermi('system:up:export')")
//    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
//    @GetMapping("/export")
//    public AjaxResult export(UserFileUp userFileUp)
//    {
//        List<UserFileUp> list = userFileUpService.selectUserFileUpList(userFileUp);
//        ExcelUtil<UserFileUp> util = new ExcelUtil<UserFileUp>(UserFileUp.class);
//        return util.exportExcel(list, "【请填写功能名称】数据");
//    }
//
//    /**
//     * 获取【请填写功能名称】详细信息
//     */
//    @PreAuthorize("@ss.hasPermi('system:up:query')")
//    @GetMapping(value = "/{userFileUp}")
//    public AjaxResult getInfo(@PathVariable("userFileUp") Integer userFileUp)
//    {
//        return AjaxResult.success(userFileUpService.selectUserFileUpById(userFileUp));
//    }
//
//    /**
//     * 新增【请填写功能名称】
//     */
//    @PreAuthorize("@ss.hasPermi('system:up:add')")
//    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
//    @PostMapping
//    public AjaxResult add(@RequestBody UserFileUp userFileUp)
//    {
//        return toAjax(userFileUpService.insertUserFileUp(userFileUp));
//    }
//
//    /**
//     * 修改【请填写功能名称】
//     */
//    @PreAuthorize("@ss.hasPermi('system:up:edit')")
//    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit( UserFileUp userFileUp)
    {
        return toAjax(userFileUpService.updateUserFileUp(userFileUp));
    }

    @PutMapping("/srcState")
    public AjaxResult edit2( UserFileUp userFileUp)
    {
        return toAjax(userFileUpService.updateUserFileUp2(userFileUp));
    }
//
//    /**
//     * 删除【请填写功能名称】
//     */
//    @PreAuthorize("@ss.hasPermi('system:up:remove')")
//    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
//	@DeleteMapping("/{userFileUps}")
//    public AjaxResult remove(@PathVariable Integer[] userFileUps)
//    {
//        return toAjax(userFileUpService.deleteUserFileUpByIds(userFileUps));
//    }
}
